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