UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'APbd43o5lSKEVPJcvTD++pEdzVdwx4mW6reqZAKIsj0='
WHERE
key_id = '28470f6ec48404a7baf6481e3874e316a29332b8206ac706d126b244da7cc531'
AND (
token = 'APbd43o5lSKEVPJcvTD++pEdzVdwx4mW6reqZAKIsj0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)