UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7Z9Yxb35cWHe6m2bTQbc9MMUOAOkWv9C6HoB8swKsAQ=' 
WHERE 
  key_id = '2de3ea71f9d36e7f65aefa06943b12b3d8342e3abcfd695bf5af9314221ce10f' 
  AND (
    token = '7Z9Yxb35cWHe6m2bTQbc9MMUOAOkWv9C6HoB8swKsAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030