UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DDBcLgjP5Arb2ED447x7zVWQqnCdMu/qfgTb68/TG4A='
WHERE
key_id = 'b5779a0d58f52e1165fe2e08f6052ff6b9c50f370db49aac9541765debbed444'
AND (
token = 'DDBcLgjP5Arb2ED447x7zVWQqnCdMu/qfgTb68/TG4A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)