UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3DnGjcAzrxwIcJMMRbY3PJ4kPC5v3+azuXu/AbQWlFM=' 
WHERE 
  key_id = 'db4b05c4ef5d07312c4e5cd1fd4b25216d7c7baac6370d48b4420407f8c6baa3' 
  AND (
    token = '3DnGjcAzrxwIcJMMRbY3PJ4kPC5v3+azuXu/AbQWlFM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025