UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '24b7JsG/1DdlpA0mFkGd8NW1KrS2NzYVJONrUQavr6U='
WHERE
key_id = '41b19e9ded68fed5b5354c9f78acb58b39eb2e4bf64ffc0b388526efc9178a92'
AND (
token = '24b7JsG/1DdlpA0mFkGd8NW1KrS2NzYVJONrUQavr6U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)