UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZBVrNlnLqFP1zDoyN+7+f8EdQxqKsM/lY+nrS+MLobo=' 
WHERE 
  key_id = '275363ce7eaead4245d6ba2b17bb6208fc844a4ad7a42b81d1845312d5de2a0f' 
  AND (
    token = 'ZBVrNlnLqFP1zDoyN+7+f8EdQxqKsM/lY+nrS+MLobo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038