UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+jlGvdS1CTCllM/pgZr5WgXwVysFqauaY21cPmm7RIo='
WHERE
key_id = '418928d6108c64140c2aac4624ffb189e3f37f3e5f64e2f358c2ec66c4a0f868'
AND (
token = '+jlGvdS1CTCllM/pgZr5WgXwVysFqauaY21cPmm7RIo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)