UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/NlI4FIoQrf3jMPx2iy/KkWn9Wz6fO4LrZ9llgLkAM4=' 
WHERE 
  key_id = 'ca085ba6d62a8913fa949206e32bc986056be1535a766225e65d3b7343858719' 
  AND (
    token = '/NlI4FIoQrf3jMPx2iy/KkWn9Wz6fO4LrZ9llgLkAM4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041