UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Rjz25RcCBYGh0EQMqkq92LfCXFoYrkOccSD0vKbijc='
WHERE
key_id = '93381016b9ea8c4ae52e6b49ee53a6605dfc505fa69f253ba067f483e44eae64'
AND (
token = '1Rjz25RcCBYGh0EQMqkq92LfCXFoYrkOccSD0vKbijc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)