UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ccifAgYGLXHrQgISYZIksnbyMlti2iCJV2HANgN7+94=' 
WHERE 
  key_id = 'e5b975d17e2f68f0f9179ccc80f2822f5fce8955d1e9d5bbb13bcbae1326dcc7' 
  AND (
    token = 'ccifAgYGLXHrQgISYZIksnbyMlti2iCJV2HANgN7+94=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021