UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f7xh5HK5rQofqQUXlMS+yC2RaS2EtyafuGw/8xTh7bk=' 
WHERE 
  key_id = '4a281d20e2292ac9d99d0016aa071a2ac9b060f231ca158fa338c3c5dd447f33' 
  AND (
    token = 'f7xh5HK5rQofqQUXlMS+yC2RaS2EtyafuGw/8xTh7bk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018