UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MW/lu9+TtEYwy7KDdHvwdGmYcuXDf1giQ4Ov9c1xlNY=' 
WHERE 
  key_id = 'dff859d2670bbbb1927b14ee85a3e00a40a754aa17b4f4d627f99382dc7ba3b3' 
  AND (
    token = 'MW/lu9+TtEYwy7KDdHvwdGmYcuXDf1giQ4Ov9c1xlNY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027