UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '092LLJKHyqr6e5fVT8cefBIEHoVhEgbH74nBIuwoT7Q=' 
WHERE 
  key_id = 'dcdefc4e948d5eae55834bfbd396db5dbdf2efc15b0bb1826904cba844d16557' 
  AND (
    token = '092LLJKHyqr6e5fVT8cefBIEHoVhEgbH74nBIuwoT7Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026