UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zV9GE6a9CFjIrugcd1kuM15bPKuQtQx3R1Yjy+Qqh9k='
WHERE
key_id = '50cd3952966d72788d22acb4f8c557506fae8bed1d5db0a98bcf4038e703bda9'
AND (
token = 'zV9GE6a9CFjIrugcd1kuM15bPKuQtQx3R1Yjy+Qqh9k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)