UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JhmCd55lUpm0H4edakIT9Bx0PfTeGjHXUn9BGMZuCEg='
WHERE
key_id = '0b4fb6709e0bf111ea313e94a8ac7392f3949de09d64e65f66ee33ff5e0e1471'
AND (
token = 'JhmCd55lUpm0H4edakIT9Bx0PfTeGjHXUn9BGMZuCEg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)