UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lEs630q5+XZVfKramdB70VV+Bm9cwPisAGq+p/vho8E=' 
WHERE 
  key_id = '761b2dfaaf02b6a6d0a6cd159d99fc833d10d5ff68bcb52168f29d363729f1e6' 
  AND (
    token = 'lEs630q5+XZVfKramdB70VV+Bm9cwPisAGq+p/vho8E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069