UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2oVxxdaCd1p6Be4hokuuf3RltniJrVPdUYxTvEiBmk0='
WHERE
key_id = '988cdca3967e402b7ffe94a242be63f73cc824abb2336bf2493fba4783dd3276'
AND (
token = '2oVxxdaCd1p6Be4hokuuf3RltniJrVPdUYxTvEiBmk0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)