UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DTK0fz8Me5jDHRBEg9sUP4joN/c4FqrHuQsq1wxPYpk=' 
WHERE 
  key_id = 'e0a10e1f7ac207d6e1aebaa4f3c63b50e6759c99ea84be73795e82f7e56f267b' 
  AND (
    token = 'DTK0fz8Me5jDHRBEg9sUP4joN/c4FqrHuQsq1wxPYpk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021