UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ECm6b+vfycg/G88/mD+zXEiBERZ4ztZOkDmYn8ZIQg4=' 
WHERE 
  key_id = 'c0bad6379e35ca290464171cc18d2247c42e69406ecc668fc4976539f0f8db50' 
  AND (
    token = 'ECm6b+vfycg/G88/mD+zXEiBERZ4ztZOkDmYn8ZIQg4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024