UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CgKYrzanOZobwLwKFA1anQ+sRr5nj9KsicApo7ZZ4+k='
WHERE
key_id = '233da23b1c56485829fdf6bb9e98be3961187a70a5bf2bb367ba3855da7fe827'
AND (
token = 'CgKYrzanOZobwLwKFA1anQ+sRr5nj9KsicApo7ZZ4+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)