UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l0iSHlILtVIbLLWXFizmXnkvIADwNkJPNreLeZQr9oA=' 
WHERE 
  key_id = '248d29077208a199530d0288cda3660a7f5c85b650d3a1d101fc7126121d715c' 
  AND (
    token = 'l0iSHlILtVIbLLWXFizmXnkvIADwNkJPNreLeZQr9oA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041