UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+NOQX2wjfFClj3jT1KcUB1o8gSW5KiQcdLeAuceG+Ew=' 
WHERE 
  key_id = 'f113df7d325cfa5df982eef42335afe5abd9b5f06d0b55ced1bce0d9bebd9db3' 
  AND (
    token = '+NOQX2wjfFClj3jT1KcUB1o8gSW5KiQcdLeAuceG+Ew=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025