UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oIxOwLbhSXbrNUDkloOjFotAw5nHfJBCLN+tkbju+28='
WHERE
key_id = '25d92ae4383e0c3af6b33916f00cd7b0613fb7d1805cc995034ec588d2a192de'
AND (
token = 'oIxOwLbhSXbrNUDkloOjFotAw5nHfJBCLN+tkbju+28='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)