UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '81DzNZmQ8amEsRW9X956b2mXoojHEAf9gJxMHlnUo38=' 
WHERE 
  key_id = 'daa38109e49d9e73f92edb930998fcefbb89027ab6fb51930d4344eea0a0a40b' 
  AND (
    token = '81DzNZmQ8amEsRW9X956b2mXoojHEAf9gJxMHlnUo38=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056