UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6IjA0UeZQWuiDWB9kw7R9EK3sBrNRxCr5V3c92Su75s=' 
WHERE 
  key_id = '6f5aad5944ee7c66a2bfe1fd5d0755fbce870d7b1ddabe58d545c3ce3bd7b43e' 
  AND (
    token = '6IjA0UeZQWuiDWB9kw7R9EK3sBrNRxCr5V3c92Su75s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022