UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ScWIzSvfr7DjDmW5fU/mRzJL/0Y896pTt2kxhmNglpU=' 
WHERE 
  key_id = '061eb31454271bfebed1950a23c49c51f4a11097f168c186c92ec385f5d08149' 
  AND (
    token = 'ScWIzSvfr7DjDmW5fU/mRzJL/0Y896pTt2kxhmNglpU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044