UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oL5F5sDBU78vKUWiQfkHixk/95u/EEjtIPT0W6VYal0='
WHERE
key_id = '773ae524115c01fa7b4a9fd76a462d689eb2ced0da70d1ee701d24e9a757fd0d'
AND (
token = 'oL5F5sDBU78vKUWiQfkHixk/95u/EEjtIPT0W6VYal0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)