UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'en966aUHYoNguMiq/NezK+s7i53nNelyWrdGeLcPa/M='
WHERE
key_id = '1fdbbb8a635b827c9120f585d9594f61b2058c529d7a838d29c9f958b7821fe8'
AND (
token = 'en966aUHYoNguMiq/NezK+s7i53nNelyWrdGeLcPa/M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)