UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H6Nka54Q6GP2yRwQ5TWxGJtSibmm4c+J2l2RwgNMF14='
WHERE
key_id = 'b15e027dfd3c9b7d62cae39643266e6f081ab6b2898568865e386d4878b01fe7'
AND (
token = 'H6Nka54Q6GP2yRwQ5TWxGJtSibmm4c+J2l2RwgNMF14='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)