UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6g25cwscL51sGqiR/6N+f/YArqhgx9OF3rRXZ5a9UGY='
WHERE
key_id = '4a169496b2d3842dc81752183609ddcb38d95c1e5cab83c3e94f2ca44588cfd7'
AND (
token = '6g25cwscL51sGqiR/6N+f/YArqhgx9OF3rRXZ5a9UGY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)