UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6X2uBRq5ng/QGorbVXcUIzK14S6+TVSj+OO4R6jz+Fs=' 
WHERE 
  key_id = '22dde3a33ecd4d7ef5793f713317d7f1a3f6f727ef1b6256ddccebc489d6ae5c' 
  AND (
    token = '6X2uBRq5ng/QGorbVXcUIzK14S6+TVSj+OO4R6jz+Fs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056