UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bmu0jeLXZOtkdlZuVx903npkk7vYs1NYBdjxxe+LxuI=' 
WHERE 
  key_id = '9ae0352aa9c5cef8e8f7d3fd93777966adb4cf62d97c848506eb35c7a1a89f8b' 
  AND (
    token = 'bmu0jeLXZOtkdlZuVx903npkk7vYs1NYBdjxxe+LxuI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030