UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vvbFpyWPrneYPomA9w6ZB/mT6G5aFotFWIaw5JpL8iA='
WHERE
key_id = 'a92534fe7ac39cce356a0e718e9a335ab59311e489ce441a52ce1005a821f373'
AND (
token = 'vvbFpyWPrneYPomA9w6ZB/mT6G5aFotFWIaw5JpL8iA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)