UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V5TJTvupf3Wtjb9/WjUJ6mdkvP+uqR4L9Io8Gd7i9Rw=' 
WHERE 
  key_id = '2cf35ae0d923045cd9e83820c800857191f1436303c9260181f12cd3523d0d0d' 
  AND (
    token = 'V5TJTvupf3Wtjb9/WjUJ6mdkvP+uqR4L9Io8Gd7i9Rw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064