UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BzMrtWqwZTHxFizQ+PWdpDw4IgA00SsFSaOt/rkEMtY=' 
WHERE 
  key_id = '3852d90eb80e50a01da5c88202e0055c0244f00ead4ed444245861a6d0c63de8' 
  AND (
    token = 'BzMrtWqwZTHxFizQ+PWdpDw4IgA00SsFSaOt/rkEMtY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045