UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IKpnvyhwJUrDryEP4A9wh/TrJA8nLgKN72Ja2/wWQec='
WHERE
key_id = 'a534f592722702a4c796af693fb4bb742ceb3fcf299765abd863aede3af02409'
AND (
token = 'IKpnvyhwJUrDryEP4A9wh/TrJA8nLgKN72Ja2/wWQec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)