UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L0pgznBu4bQGAuhWBZQpucsTW4/sEO48E/Kx8bcqJGs='
WHERE
key_id = '04612bd84fb2f30642d6a1e23c7775a76a793fef2ea8aa5c1248f381b30d2179'
AND (
token = 'L0pgznBu4bQGAuhWBZQpucsTW4/sEO48E/Kx8bcqJGs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)