UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uy68QVGzNMr2XZmz4/xyZDuyooNo1mWIS6CFGPmqZ58=' 
WHERE 
  key_id = 'e83de708809dce172ca08ccc3de25b9f52f1641ed7333d00298fdfc1faa27649' 
  AND (
    token = 'uy68QVGzNMr2XZmz4/xyZDuyooNo1mWIS6CFGPmqZ58=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022