UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eEFrjuizHFj+BKloI5tklhm+CEMIr1iNUKMifH6L5iE=' 
WHERE 
  key_id = '5546b1d2fb400d90d0c89a9127b13604fd002573b17a3ab901be4f5df0731969' 
  AND (
    token = 'eEFrjuizHFj+BKloI5tklhm+CEMIr1iNUKMifH6L5iE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038