UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p8xC1YwVrRvPIdx4Z3aomHQiHUJP1B+DD54XqLoIwIQ='
WHERE
key_id = '92b0c248227c08a4894a5f7f0eb4df41249bf050c552187d76afa20a9c3c8398'
AND (
token = 'p8xC1YwVrRvPIdx4Z3aomHQiHUJP1B+DD54XqLoIwIQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)