UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jcpx5+nRSQq2Qn9SD4izSYgD3kWPbigpILeDRfA6IHA=' 
WHERE 
  key_id = '8f0e1d45572e7ec1963c4cebf04a335c426bce9e15d22de0cd6bd4f3cc42a2c1' 
  AND (
    token = 'Jcpx5+nRSQq2Qn9SD4izSYgD3kWPbigpILeDRfA6IHA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031