UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jITNE0uqXs5pqhsKkpocjj7c/j6Vxsh9lshSYtsDq70=' 
WHERE 
  key_id = '145f78b28414fff94f0724e867db18068621e7ace828b50c9b6834a44a97e73d' 
  AND (
    token = 'jITNE0uqXs5pqhsKkpocjj7c/j6Vxsh9lshSYtsDq70=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039