UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LiV3qIIHqZ3BKRkKQRTtXsJNdhpNGV3Um7yOfMLZ2IE='
WHERE
key_id = 'fcdd1185e9f1c3bf413cb5a07269aa98748618aaefc32b9c022715f266ce499f'
AND (
token = 'LiV3qIIHqZ3BKRkKQRTtXsJNdhpNGV3Um7yOfMLZ2IE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)