UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0ZGkY6gYXFXzmsSBluY00Rx3H8s++n22zxdGYPev0SM=' 
WHERE 
  key_id = '1b598aa0efe991589bfb0a268a3480c84919ea7c14c7fa254d44292209f866cf' 
  AND (
    token = '0ZGkY6gYXFXzmsSBluY00Rx3H8s++n22zxdGYPev0SM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045