UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2n2kq3exGtdvBuur0zcbB+Q3sW/x5Z33whBVwQz3jSw=' 
WHERE 
  key_id = '28d9ee41dde4e7139e0932aa5fd1d2a8af6e265b83d7cdd77a9da7b061db96db' 
  AND (
    token = '2n2kq3exGtdvBuur0zcbB+Q3sW/x5Z33whBVwQz3jSw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030