UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vjLgdq4IFXM2ap3soTcfowquh/pUGTOlgVcvtXpIryA=' 
WHERE 
  key_id = '57bcb879cab4229316781a2cb2bf7e6ab5532b3ae410b9534b6903a44f9bd6f2' 
  AND (
    token = 'vjLgdq4IFXM2ap3soTcfowquh/pUGTOlgVcvtXpIryA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046