UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0uAbnMD9gnrp91v+A4ajJTqLplM5cWlhzf/PsofMLMM='
WHERE
key_id = '8e553903a9b1267aa0a1d4de7a7efb7d855690405871af7f119e0ee1d1cf8c6f'
AND (
token = '0uAbnMD9gnrp91v+A4ajJTqLplM5cWlhzf/PsofMLMM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)