UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PnEXYtg+R9dQcwPfGkxIv9QYHG7CGOa9hA6/5O8Zntk='
WHERE
key_id = 'f4eb893cc66a658b28d9d6d9d9dbb7e19a2d7fbe5bb7cd8a058034dbd475be2a'
AND (
token = 'PnEXYtg+R9dQcwPfGkxIv9QYHG7CGOa9hA6/5O8Zntk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)